/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.bigstorage.entity;

import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 商品表Entity
 * @author zhuqingya
 * @version 2019-12-13
 */
@Table(name="biz_goods_spec", alias="a", columns={
		@Column(name="id", attrName="id", label="唯一标识", isPK=true),
		@Column(name="goods_id", attrName="goodsId.id", label="商品id"),
		@Column(name="sort", attrName="sort", label="顺序"),
		@Column(name="code", attrName="code", label="编码"),
		@Column(name="name", attrName="name", label="名称", queryType=QueryType.LIKE),
		@Column(name="price", attrName="price", label="吊牌价"),
		@Column(name="member_price", attrName="memberPrice", label="普通会员价"),
		@Column(name="vip_price", attrName="vipPrice", label="VIP会员价"),
		@Column(name="agent_price", attrName="agentPrice", label="代购费"),
		@Column(name="stock", attrName="stock", label="库存"),
		@Column(name="deleted", attrName="deleted", label="删除"),
		@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
		@Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false),
		@Column(name="update_by", attrName="updateBy", label="更新者", isQuery=false),
		@Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false),
		@Column(name="remarks", attrName="remarks", label="备注信息", queryType=QueryType.LIKE),
	}, orderBy="a.create_date ASC"
)
public class GoodsSpec extends DataEntity<GoodsSpec> {
	
	private static final long serialVersionUID = 1L;
	private Goods goodsId;		// 商品id 父类
	private Long sort;		// 顺序
	private String code;		// 编码
	private String name;		// 名称
	private Double price;		// 吊牌价
	private Double memberPrice;		// 普通会员价
	private Double vipPrice;		// VIP会员价
	private Double agentPrice;		// 代购费
	private Long stock;		// 库存
	private String deleted;		// 删除
	
	public GoodsSpec() {
		this(null);
	}


	public GoodsSpec(Goods goodsId){
		this.goodsId = goodsId;
	}
	
	@NotBlank(message="商品id不能为空")
	@Length(min=0, max=64, message="商品id长度不能超过 64 个字符")
	public Goods getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(Goods goodsId) {
		this.goodsId = goodsId;
	}
	
	@NotNull(message="顺序不能为空")
	public Long getSort() {
		return sort;
	}

	public void setSort(Long sort) {
		this.sort = sort;
	}
	
	@NotBlank(message="编码不能为空")
	@Length(min=0, max=255, message="编码长度不能超过 255 个字符")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@NotBlank(message="名称不能为空")
	@Length(min=0, max=255, message="名称长度不能超过 255 个字符")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@NotNull(message="吊牌价不能为空")
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}
	
	@NotNull(message="普通会员价不能为空")
	public Double getMemberPrice() {
		return memberPrice;
	}

	public void setMemberPrice(Double memberPrice) {
		this.memberPrice = memberPrice;
	}
	
	@NotNull(message="VIP会员价不能为空")
	public Double getVipPrice() {
		return vipPrice;
	}

	public void setVipPrice(Double vipPrice) {
		this.vipPrice = vipPrice;
	}
	
	@NotNull(message="代购费不能为空")
	public Double getAgentPrice() {
		return agentPrice;
	}

	public void setAgentPrice(Double agentPrice) {
		this.agentPrice = agentPrice;
	}
	
	@NotNull(message="库存不能为空")
	public Long getStock() {
		return stock;
	}

	public void setStock(Long stock) {
		this.stock = stock;
	}
	
	public String getDeleted() {
		return deleted;
	}

	public void setDeleted(String deleted) {
		this.deleted = deleted;
	}
	
}